import { createSSRApp } from "vue";
import App from "./App.vue";
import { createPinia } from "pinia";
import { createUnistorage } from "pinia-plugin-unistorage";
export function createApp() {
  // createSSRApp 创建Vue 应用实例
  const app = createSSRApp(App);

  // createPinia 创建 pinia 实例
  const pinia = createPinia();

  // 使用unistorage插件，让pinia支持持久化存储
  pinia.use(createUnistorage());

  // 把 pinia 整合到 Vue 应用实例中
  app.use(pinia);

  return {
    app,
  };
}
